var http=require("http")
var fs=require("fs")
var template=require('art-template')
let person=[{name:"马超",age:22},{name:"文文",age:12}]
var server=http.createServer();
server.on('request',function(request,response){
    fs.readFile('./模板引擎/服务端.html',function(error,data){
        // console.log(data)
         let com=template.render(data.toString(),{
           person:person
         })
         console.log(com)
         response.end(com)
    })

})

server.listen(3005,function(){
    console.log("服务器启动成功")
})